home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / banging_the_metal / qdos / qdos4amiga3.lha / D68K_readme < prev    next >
Text File  |  1998-02-24  |  3KB  |  122 lines

  1. Short:    SuperBASIC toolkit for disassembling files & memory
  2. Uploader: msw@blackpool.ac.uk
  3. Author:   frans (francis swift)
  4. Version:  1.27
  5.  
  6.  
  7. VERSION 1.27 ARCHIVE CONTENTS
  8.  
  9.  D68K_rext   - The toolkit.
  10.  D68K_readme - This file.
  11.  
  12.  
  13. FEATURES
  14.  
  15. * Disassembles files & memory
  16. * SMALL and FAST
  17. * Provides a user link for single-line disassembly
  18. * FREEWARE
  19.  
  20.  
  21. SUPERBASIC KEYWORDS
  22.  
  23. MDIS [#<chan>,]<pc>,[<org><length>]
  24.  
  25. This procedure disassembles <length> bytes of code at address
  26. <pc>. The disassembly is printed to #<chan> or to #1 if no
  27. channel is specified. Optionally relocated to address <org>.
  28.  
  29. FDIS [#<chan>,]<filename$>,[<pc>,[<org>[<length>]]
  30.  
  31. As above, but disassembles <length> bytes from the specified
  32. <filename$>.
  33.  
  34. D68K <pc>,[<org><buffer>]
  35.  
  36. This function disassembles one m/c instruction at address <pc>.
  37. The disassembly is stored as a C string (0 terminated) in an
  38. ASCII buffer at address <buffer>. Optionally relocated to
  39. address <org>. The function returns the number of bytes
  40. disassembled. You must allocate a buffer of at least 256 bytes
  41. before using this function.
  42.  
  43.  
  44. ADVANCED USER INFORMATION
  45.  
  46. D68K makes use of an entry in the THING list that allows access
  47. to D68K routines which disassemble a single-line of code.
  48.  
  49. Currently D68Ks' THING is 64 bytes long and contains the
  50. following entries:
  51.  
  52. Offset   Value    meaning
  53.  
  54. $26      '1.27'   version number
  55. $2A      4        name length
  56. $2C      'd68k'   name
  57. $30      'THG%'   thing variables follow
  58. $34      2        freeform shared code
  59. $38      ?        address of a 256 byte buffer (private)
  60. $3C      ?        address of single-line disassembly routine
  61.  
  62.  
  63. Finding D68Ks' THING entry
  64.  
  65. The following machine code could be used to find D68ks' THING
  66. entry. It returns with the address of the thing in A4.
  67.  
  68.  Entry: none
  69.  
  70.  Exit:  A0 = corrupted
  71.         A4 = address of D68ks' thing entry or zero
  72.         D0 = corrupted
  73.         D1 = corrupted
  74.         D2 = corrupted
  75.  
  76. FIND_THG:
  77.          moveq    #MT.INF,d0        ; find system variables
  78.          trap     #1
  79.  
  80.          lea      $B8(a0),a4        ; start of THING list
  81.  
  82. NEXT_THG:
  83.          move.l   (a4),d0
  84.          move.l   d0,a4
  85.          beq.s    EXIT              ; exit if not found
  86.  
  87.          cmp.w    #4,$2A(a4)        ; compare name length
  88.          bne.s    NEXT_THG
  89.  
  90.          cmp.l    #'d68k',$2C(a4)   ; compare name
  91.          bne.s    NEXT_THG
  92.  
  93. EXIT:
  94.          rts
  95.  
  96.  
  97. Single-line disassembly routine (THING offset $3C)
  98.  
  99. The routine pointed to by offset $3C in D68ks' THING entry
  100. disassembles one m/c instruction at address <pc>. The
  101. disassembly is stored as a C string (0 terminated) in an ASCII
  102. buffer and is optionally relocated to address <org>. Returns
  103. the number of bytes disassembled in d0.
  104.  
  105.  Entry: A0 = <pc>
  106.         A1 = <org>
  107.         A2 = 256 byte ASCII buffer
  108.  
  109.  Exit:  A0 = updated pc
  110.         A1 = updated org
  111.         A2 = updated buffer
  112.         d0 = number of bytes disassembled
  113.  
  114.  
  115. CONTACT
  116.  
  117.  post: FRANCIS SWIFT
  118.        325 CHARLESTOWN ROAD
  119.        BLACKLEY
  120.        MANCHESTER M9 7BS
  121.        UK
  122.